package com.brokendust.client.config.module.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.util.ArrayList;
import java.util.List;

public class ImageDownLoadJson {
    List<String> image_path_list;

    public ImageDownLoadJson() {
        this.image_path_list = new ArrayList<String>();
    }

    public ImageDownLoadJson(List<String> image_path_list) {
        this.image_path_list = new ArrayList<String>();
        this.image_path_list = image_path_list;
    }

    public static ImageDownLoadJson readJSON(String string) {
        GsonBuilder builder = new GsonBuilder();
        Gson gson = builder.create();
        return gson.fromJson(string, ImageDownLoadJson.class);
    }

    public void addImagePath(String path) {
        if (path.startsWith("http")) {
            this.image_path_list.add(path);
        }
    }

    public List<String> getImage_path_list() {
        return this.image_path_list;
    }

    public void setImage_path_list(List<String> image_path_list) {
        this.image_path_list = image_path_list;
    }
}
